<?php

/**
 * Register all actions and filters for the plugin
 *
 * @link       https://git.oschina.net/wostech/wp-wxtpp
 * @since      1.0.0
 *
 * @package    WP_WXTPP
 * @subpackage WP_WXTPP/includes
 */

/**
 * WXTPP admin bar.
 *
 *
 * @package    WP_WXTPP
 * @subpackage WP_WXTPP/includes
 * @author     Yajun Hu <yjhu@126.com>
 */
class WP_WXTPP_Admin_Bar extends WP_Admin_Bar {
    public function add_menus(){
        // User related, aligned right.
        add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_menu', 0 );
        add_action( 'admin_bar_menu', 'wp_admin_bar_search_menu', 4 );
        add_action( 'admin_bar_menu', 'wp_admin_bar_my_account_item', 7 );

        // Site related.
        add_action( 'admin_bar_menu', 'wp_admin_bar_sidebar_toggle', 0 );
//        add_action( 'admin_bar_menu', 'wp_admin_bar_wp_menu', 10 );
        if ( is_super_admin() ) {
            add_action( 'admin_bar_menu', 'wp_admin_bar_my_sites_menu', 20 );
            add_action( 'admin_bar_menu', 'wp_admin_bar_site_menu', 30 );
            add_action( 'admin_bar_menu', 'wp_admin_bar_customize_menu', 40 );
            add_action( 'admin_bar_menu', 'wp_admin_bar_updates_menu', 50 );
        }
   
        add_action( 'admin_bar_menu', 'wp_admin_bar_edit_menu', 80 );

        add_action( 'admin_bar_menu', 'wp_admin_bar_add_secondary_groups', 200 );

        /**
         * Fires after menus are added to the menu bar.
         *
         * @since 3.1.0
         */
        do_action( 'add_admin_bar_menus' );
    }
}
